import request from '@/utils/request'

// 获取角色列表
export function getRoleList(queryParams) {
  return request({
    url: '/user/role/list',
    method: 'get',
    params: queryParams
  })
}

// 获取多选框角色列表
export function getRoleOptionSelect() {
  return request({
    url: '/user/role/optionSelect',
    method: 'get'
  })
}

// 新增角色
export function addRole(data) {
  return request({
    url: '/user/role',
    method: 'post',
    params: data
  })
}

// 删除角色
export function delRole(id) {
  return request({
    url: '/user/role/' + id,
    method: 'delete'
  })
}

// 更新角色
export function updateRole(data) {
  return request({
    url: '/user/role',
    method: 'put',
    data: data
  })
}
